﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeSplineEnt3d : OdGeCurve3d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeSplineEnt3d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeSplineEnt3d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeSplineEnt3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeSplineEnt3d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeSplineEnt3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public bool isRational()
		{
			bool result = GlobalsPINVOKE.OdGeSplineEnt3d_isRational(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int degree()
		{
			int result = GlobalsPINVOKE.OdGeSplineEnt3d_degree(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int order()
		{
			int result = GlobalsPINVOKE.OdGeSplineEnt3d_order(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int numKnots()
		{
			int result = GlobalsPINVOKE.OdGeSplineEnt3d_numKnots(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeKnotVector knots()
		{
			OdGeKnotVector result = new OdGeKnotVector(GlobalsPINVOKE.OdGeSplineEnt3d_knots(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int numControlPoints()
		{
			int result = GlobalsPINVOKE.OdGeSplineEnt3d_numControlPoints(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int continuityAtKnot(int index, OdGeTol tol)
		{
			int result = GlobalsPINVOKE.OdGeSplineEnt3d_continuityAtKnot__SWIG_0(this.swigCPtr, index, OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int continuityAtKnot(int index)
		{
			int result = GlobalsPINVOKE.OdGeSplineEnt3d_continuityAtKnot__SWIG_1(this.swigCPtr, index);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double startParam()
		{
			double result = GlobalsPINVOKE.OdGeSplineEnt3d_startParam(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double endParam()
		{
			double result = GlobalsPINVOKE.OdGeSplineEnt3d_endParam(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d startPoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeSplineEnt3d_startPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d endPoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeSplineEnt3d_endPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool hasFitData()
		{
			bool result = GlobalsPINVOKE.OdGeSplineEnt3d_hasFitData(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double knotAt(int knotIndex)
		{
			double result = GlobalsPINVOKE.OdGeSplineEnt3d_knotAt(this.swigCPtr, knotIndex);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeSplineEnt3d setKnotAt(int knotIndex, double val)
		{
			OdGeSplineEnt3d result = new OdGeSplineEnt3d(GlobalsPINVOKE.OdGeSplineEnt3d_setKnotAt(this.swigCPtr, knotIndex, val), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d controlPointAt(int controlPointIndex)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeSplineEnt3d_controlPointAt(this.swigCPtr, controlPointIndex), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeSplineEnt3d setControlPointAt(int controlPointIndex, OdGePoint3d point)
		{
			OdGeSplineEnt3d result = new OdGeSplineEnt3d(GlobalsPINVOKE.OdGeSplineEnt3d_setControlPointAt(this.swigCPtr, controlPointIndex, OdGePoint3d.getCPtr(point)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeSplineEnt3d Assign(OdGeSplineEnt3d spline)
		{
			OdGeSplineEnt3d result = new OdGeSplineEnt3d(GlobalsPINVOKE.OdGeSplineEnt3d_Assign(this.swigCPtr, OdGeSplineEnt3d.getCPtr(spline)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
